<template>
	<view>
		<view class="addBox">
			<view class="addList" v-for="(item, index) in addLists" :key="index">
				<u-swipe-action>
					<u-swipe-action-item :options="options">
						<view class="listPads">
							<view class="addTitle">{{item.name}}</view>
							<view class="addcontnt">{{item.phoneNumber}}</view>
							<view class="addcontnt">{{item.address}}</view>
						</view>
					</u-swipe-action-item>
				</u-swipe-action>
			</view>
		</view>
		<view class="addfoot">
			<view class="addBtn" @click="btnAddress()">添加地址</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				options: [{
					text: '编辑',
					style: {
						backgroundColor: '#0782C9',
						fontSize: '28rpx'
					}
				}, {
					text: '删除',
					style: {
						backgroundColor: '#DE6B60',
						fontSize: '28rpx'
					}
				}],
				addLists:[
					{
						name:'丰子恺',
						phoneNumber:'18692735288',
						address:'福建省厦门市湖里区应天府8栋2单元2403'
					},
					{
						name:'丰子琪',
						phoneNumber:'13203126653',
						address:'广东省佛山市南海区南海大道城市花园2期7栋1201111111111111111111111111111'
					}
				]
			}
		},
		methods: {
			btnAddress(){
				uni.navigateTo({
					url:'/pages-my/address/addressDetails'
				})
			}
		}
	}
</script>

<style lang="scss">
	body {
		background-color: $uni-bg-color-grey;
	}
	.addBox{
		padding: 20rpx;
	}
	.addList{
		border-radius: 10rpx;
		overflow: hidden;
		margin-bottom: 20rpx;
		box-shadow: 3rpx 3rpx 6rpx 0 #D3D0D0;
	}
	.listPads{
		padding: 40rpx;
		font-size: 28rpx;
	}
	.addTitle{
		font-weight: bold;
	}
	.addcontnt{
		font-size: 26rpx;
		color: #606266;
		padding-top: 10rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.addfoot {
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 140rpx;
		box-shadow: 0 -5rpx 10rpx #D3D0D0;
	}
	
	.addBtn {
		width: 90%;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background: linear-gradient(to left, $uni-aicloud, $uni-aicloud-gradation);
		color: #ffffff;
		font-size: 28rpx;
		border-radius: 80rpx;
		margin: 30rpx auto;
	}
</style>